package com.yusys.pattern.mode.single;

/**
 * 懒汉式
 * 静态内部类 线程安全有jvm保证 的线程安全单例
 */
public class SafeSingle2 {

    private static class ContextHolder{
        private static final SafeSingle2 instance = new SafeSingle2();
    }

    public static SafeSingle2 getInstance(){
        return ContextHolder.instance;
    }
}
